$(document).ready(function(){


  var playlist = [{
      title:"我们来了",
      lrc:"1",
      artist:"十四冬宣传歌曲",
      mp3:"http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/1.%E6%88%91%E4%BB%AC%E6%9D%A5%E4%BA%86MMM.mp3",
      //oga:"http://www.jplayer.org/audio/ogg/Miaow-02-Hidden.ogg",
      // poster: "http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/07.jpeg"
    },{
      title:"九州同时刻",
      lrc:"2",
      artist:"十四冬宣传歌曲",
      mp3:"http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/6.%E4%B9%9D%E5%B7%9E%E5%90%8C%E6%AD%A4%E5%88%BB%20mix1.mp3",
      // poster: "http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/07.jpeg"
    },{
      title:"一起飞翔",
      lrc:"3",
      artist:"十四冬宣传歌曲",
      mp3:"http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/4.%E4%B8%80%E8%B5%B7%E9%A3%9E%E7%BF%94%20MIX%201217.wav",
     //  poster: "http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/07.jpeg"
    },{
      title:"相约在银色的世界",
      lrc:"4",
      artist:"十四冬宣传歌曲",
      mp3:"http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/3.%E7%9B%B8%E7%BA%A6%E5%9C%A8%E9%93%B6%E8%89%B2%E7%9A%84%E4%B8%96%E7%95%8CMIX.%281%29.mp3",
      // poster: "http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/07.jpeg"
    },{
      title:"冬天的童话",
      artist:"十四冬宣传歌曲",
      lrc:"5",
      mp3:"http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/2.%E5%86%AC%E5%A4%A9%E7%9A%84%E7%AB%A5%E8%AF%9D%20%20MIX.wav",
      //oga:"http://www.jplayer.org/audio/ogg/TSP-01-Cro_magnon_man.ogg",
      // poster: "http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/07.jpeg"
    },{
      title:"冰雪上的火焰",
      lrc:"6",
      artist:"十四冬宣传歌曲",
      mp3:"http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/5.%E5%86%B0%E9%9B%AA%E4%B8%8A%E7%9A%84%E7%81%AB%E7%84%B0.mp3",
      // poster: "http://qgssd.oss-cn-huhehaote.aliyuncs.com/gq/07.jpeg"
    }
  ];
  
  var cssSelector = {
    jPlayer: "#jquery_jplayer",
    cssSelectorAncestor: ".music-player"
  };
  
  var options = {
    swfPath: "http://cdnjs.cloudflare.com/ajax/libs/jplayer/2.6.4/jquery.jplayer/Jplayer.swf",
    supplied: "ogv, m4v, oga, mp3",
    timeupdate: function(event) {
      if(event.jPlayer.status.currentTime==0){
        time = "";
      }else {
        time = event.jPlayer.status.currentTime;
      }
    },
    play: function(event) {
      // alert(event.jPlayer.status.media.lrc);
      //点击开始方法调用lrc。start歌词方法 返回时间time
      $.lrc.stop();
      // $("#lrc_list").removeAttr("style").html("<li>歌曲播放完毕！</li>");
      $.lrc.start($('#lrc_content_'+event.jPlayer.status.media.lrc).val(), function() {
        return time;
      });
    },
    ended:function(event){
      $.lrc.stop();
      // $("#lrc_list").removeAttr("style").html("<li>歌曲播放完毕！</li>");
    },
    autoPlay:true
  };
  
  var myPlaylist = new jPlayerPlaylist(cssSelector, playlist, options);
  
});


